﻿<UserControl
	xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
			xmlns:map="clr-namespace:Microsoft.Maps.MapControl;assembly=Microsoft.Maps.MapControl"
			xmlns:DeepEarth_BingMapsToolkit_Client_Controls="clr-namespace:DeepEarth.BingMapsToolkit.Client.Controls;assembly=DeepEarth.BingMapsToolkit.Client.Controls.Find"
			xmlns:p="clr-namespace:DeepEarth.BingMapsToolkit.Client.Controls;assembly=DeepEarth.BingMapsToolkit.Client.Controls.PersistedState"
			xmlns:fp="clr-namespace:DeepEarth.BingMapsToolkit.Client.Controls;assembly=DeepEarth.BingMapsToolkit.Client.Controls.FloatingPanel"
			xmlns:d="clr-namespace:SMIL.DrawingTools;assembly=SMIL.DrawingTools"
			xmlns:d1="http://schemas.microsoft.com/expression/blend/2008" 
			xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d1" 
			xmlns:layer="clr-namespace:SMIL.Client.WPXAP.LayerPanel;assembly=SMIL.Client.WPXAP.LayerPanel"
			xmlns:lc="clr-namespace:DeepEarth.BingMapsToolkit.Client.Controls.Dialogs;assembly=DeepEarth.BingMapsToolkit.Client.Controls.LayerPanel"
			xmlns:minimap="clr-namespace:DeepEarth.BingMapsToolkit.Client.Controls;assembly=DeepEarth.BingMapsToolkit.Client.Controls.MiniMap"
			x:Class="SMIL.Client.CoordinateXAP.MainPage"
			Background="Black"
			 >

	<UserControl.Resources>

		<ResourceDictionary>
			<ResourceDictionary.MergedDictionaries>
				<ResourceDictionary Source="/DeepEarth.BingMapsToolkit.Client.Common;component/Resources/CommonStyles.xaml" />
			</ResourceDictionary.MergedDictionaries>
		</ResourceDictionary>

	</UserControl.Resources>

	<Grid x:Name="LayoutRoot">
	

		<VisualStateManager.VisualStateGroups>
			<VisualStateGroup x:Name="MyMouseStates">
				<VisualState x:Name="MyMouseEnter">
					<Storyboard>
						<DoubleAnimation Duration="0:0:0.3" To="56" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.Y)" Storyboard.TargetName="sPanel" d1:IsOptimized="True"/>
						<DoubleAnimation Duration="0:0:0.3" To="0" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.X)" Storyboard.TargetName="sPanel" d1:IsOptimized="True"/>
						<DoubleAnimation Duration="0:0:0.3" To="1" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="sPanel" d1:IsOptimized="True"/>
					</Storyboard>
				</VisualState>
				<VisualState x:Name="My2ndMouseState">
					<Storyboard>
						<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="sPanel" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.Y)">
							<EasingDoubleKeyFrame KeyTime="00:00:00" Value="56"/>
							<EasingDoubleKeyFrame KeyTime="00:00:00.3000000" Value="0"/>
						</DoubleAnimationUsingKeyFrames>
					</Storyboard>
				</VisualState>
			</VisualStateGroup>
		</VisualStateManager.VisualStateGroups>

		<map:Map x:Name="map" 
				 NavigationVisibility="Collapsed" 
				 LogoVisibility="Collapsed"
				 ScaleVisibility="Collapsed"         
				 />
		<p:PersistedState MapName="map" x:Name="persisted" />
		
		
		<fp:FloatingPanel x:Name="searchPanel" Height="50" Width="Auto" Title="Search" SnapPosition="Left">

			<DeepEarth_BingMapsToolkit_Client_Controls:FindControl 
					x:Name="findControl" 
					HorizontalAlignment="Left" 
					MapName="map" 
					VerticalAlignment="Top"  BorderThickness="0"
					ToolTipService.ToolTip="Sök" Margin="4,8" />

		</fp:FloatingPanel>
		
		<fp:FloatingPanel x:Name="miniMapPanel" Title="Overview" SnapPosition="BottomRight">
			<minimap:MiniMap MapName="map" />
		</fp:FloatingPanel>

		
		<Border x:Name="sPanel" 
			Height="64" 
			CornerRadius="8" 
			VerticalAlignment="Top" 
			Opacity="0.84" 
			Background="#FF7C7C7C" Margin="0,-56,0,0" RenderTransformOrigin="0.5,0.5" Grid.ColumnSpan="2">
			<!-- #FF373636-->
			<Border.RenderTransform>
				<TransformGroup>
					<ScaleTransform/>
					<SkewTransform/>
					<RotateTransform/>
					<TranslateTransform/>
				</TransformGroup>
			</Border.RenderTransform>
			<StackPanel Orientation="Horizontal">
				<StackPanel Orientation="Horizontal">

					<d:DrawingTool x:Name="drawingTool" ParentMap="{Binding ElementName=map}" />

					<Button x:Name="bFullscren" Click="bFullScreen_Click" Margin="4,8" Style="{StaticResource ButtonStyle}" ToolTipService.ToolTip="Full screen">
						<Image Source="Images/FullScreen.png" Height="34"  Stretch="Uniform" />
					</Button>

					<Button x:Name="bSearch" Click="bSearch_Click" Margin="4,8" Style="{StaticResource ButtonStyle}" ToolTipService.ToolTip="Find">
						<Image Source="Images/search.png" Height="34"  Stretch="Uniform" />
					</Button>
					
					<Button x:Name="bMini" Click="bMini_Click" Margin="4,8" Style="{StaticResource ButtonStyle}" ToolTipService.ToolTip="Overview">
						<Image Source="Images/Overview.png" Height="34"  Stretch="Uniform" />
					</Button>

					
				</StackPanel>

				<StackPanel HorizontalAlignment="Right" VerticalAlignment="Top">
					<Image Source="Images/RedPin.png" x:Name="redPin" Stretch="Uniform" MouseLeftButtonUp="Image_GrayPinLeftButtonUp" Height="24" Margin="0,2,2,0" 
				   HorizontalAlignment="Right"
				   VerticalAlignment="Top"
				   RenderTransformOrigin="0.5,0.5" >
						<Image.RenderTransform>
							<TransformGroup>
								<ScaleTransform/>
								<SkewTransform/>
								<RotateTransform x:Name="imageAngle" Angle="90"/>
								<TranslateTransform/>
							</TransformGroup>
						</Image.RenderTransform>
					</Image>
				</StackPanel>
			</StackPanel>
		</Border>
	</Grid>
</UserControl>
